function populateServerMenu(hServerMenu)
% POPULATESERVERMENU reads available DAS services for browsing in DASMiner
% 
% POPULATESERVERMENU read the local structure that stores all DAS services 
% and populates the server popupmenu in DASMiner GUI.
% 
% SYNTAX: populateServerMenu(hServerMenu)
%          hServerMenu - handle for the server popupmenu
%
% See also ADDNEWSERVER, SEARCHREGISTRY_GUI
%  
%    DASMiner: DAS library and browser for Matlab.
%    Diogo Veiga, March 2008.

try
   strServer = load('localServ.mat', 'locServ');
   locServ = strServer.locServ;
catch
    %create default services Uniprot and UCSC
    addNewServer('DS_409', 'uniprot', 0);    %Uniprot
    addNewServer('DS_546', 'UCSC Gencode', 0);    %UCSC
    strServer = load('localServ.mat', 'locServ');
    locServ = strServer.locServ;
end

servers = 'Choose Data Server ...';

for i=1:size(locServ,2)
    servers = strvcat(servers,locServ(i).title);
end
servers = strvcat(servers,'Add Data Server ...');

set(hServerMenu,'String',cellstr(servers));
set(hServerMenu,'Value',1);